package com.example.tivi.util;

import android.content.Context;
import vn.tdx.androidlibs.util.PreferenceUtils;

public class Preferences extends PreferenceUtils{

	private static final String fileName="preferences";
	private Context mContext;
	private Preferences(Context context, String fileName, int mode) {
		super(context, fileName, mode);
		mContext=context;
	}
	
	private static Preferences preferences;
	public static Preferences getInstance(Context context){
		if(preferences==null){
			preferences=new Preferences(context, fileName, Context.MODE_PRIVATE);
		}
		return preferences;
	}
	
	public int getVersionURL(){
		return getInstance(mContext).getPreference().getInt("ver", -1); 
	}
	public void setVersionURL(int version){
		getInstance(mContext).getEditor().putInt("ver", version).commit();
	}
}
